<script setup>
import {onMounted, ref} from 'vue'

const user = ref(getUser());
const gender=ref('');

onMounted(()=>{
  console.log(user.value)
  if(user.value.gender==1)
    gender.value="男";
  if(user.value.gender==0)
    gender.value="女";

})

</script>

<template>
  <el-descriptions title="个人信息" border>
    <el-descriptions-item
        :rowspan="2"
        :width="140"
        label="Photo"
        align="center"
    >
      <el-image
          style="width: 100px; height: 100px"
          :src="BASE_URL+user.avatar"
      />
    </el-descriptions-item>
    <el-descriptions-item label="用户名">{{ user.username }}</el-descriptions-item>
    <el-descriptions-item label="用户昵称">{{ user.nickname }}</el-descriptions-item>
    <el-descriptions-item label="邮箱">{{ user.email }}</el-descriptions-item>
    <el-descriptions-item label="电话号码">{{ user.phone }}</el-descriptions-item>
    <el-descriptions-item label="性别">{{ gender }}</el-descriptions-item>
    <el-descriptions-item label="帐号注册时间">{{ user.createTime }}</el-descriptions-item>
  </el-descriptions>
</template>

<style scoped>

</style>